import 'package:flutter/cupertino.dart';

import '../../../main.dart';
import '../../fintness_app_theme.dart';

class KCalFake extends StatelessWidget {
  final AnimationController animationController;
  final Animation animation;
  final String title;
  final int value;
  final String unit;
  final String image;
  final String color;

  const KCalFake(
      {Key key,
      this.animationController,
      this.animation,
      this.title,
      this.value,
      this.unit,
      this.image,
      this.color})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(left: 0, top: 0),
      child: Row(
        children: <Widget>[
          Container(
            height: 48,
            width: 2,
            decoration: BoxDecoration(
              color: HexColor(color).withOpacity(0.5),
              borderRadius: BorderRadius.all(Radius.circular(4.0)),
            ),
          ),
          Padding(
            padding: EdgeInsets.only(left: 5),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.only(left: 4, bottom: 2),
                  child: Text(
                    title,
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      fontFamily: FintnessAppTheme.fontName,
                      fontWeight: FontWeight.w500,
                      fontSize: 16,
                      letterSpacing: -0.1,
                      color: FintnessAppTheme.grey.withOpacity(0.5),
                    ),
                  ),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.end,
                  children: <Widget>[
                    SizedBox(
                      width: 28,
                      height: 28,
                      child: Image.asset(image),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(left: 3, bottom: 3),
                      child: Text(
                        '${(1127 * animation.value).toInt()}',
                        textAlign: TextAlign.center,
                        style: TextStyle(
                          fontFamily: FintnessAppTheme.fontName,
                          fontWeight: FontWeight.w600,
                          fontSize: 16,
                          color: FintnessAppTheme.darkerText,
                        ),
                      ),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(left: 4, bottom: 3),
                      child: Text(
                        unit,
                        textAlign: TextAlign.center,
                        style: TextStyle(
                          fontFamily: FintnessAppTheme.fontName,
                          fontWeight: FontWeight.w600,
                          fontSize: 12,
                          letterSpacing: -0.2,
                          color: FintnessAppTheme.grey.withOpacity(0.5),
                        ),
                      ),
                    ),
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
